#!usr/bin/perl -w

#定义了Description类
package Description;

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(Parse Txt Version GroupDes);
use strict;

sub new()
{
	my $self={};
	bless $self;
	$self->Construct();
	return $self;
}

sub Construct()
{
	my $this=shift;
	$this->{'iTxt'}="";
	$this->{'iVer'}=0;
	$this->{'iGroupDes'}="";
}

sub Parse()
{
	my $this=shift;
	my ($hashRef)=@_;
	while (my ($key,$value)=each(%$hashRef))
	{
		if ($key eq "text")
		{
			$this->Txt($value);
		}
		elsif ($key eq "version")
		{
			$this->Version($value);
		}
		elsif ($key eq "groupDescribe")
		{
			$this->GroupDes($value);
		}
	}
}

sub Txt()
{
	my $this=shift;
	my ($txt)=@_;
	if (defined $txt)
	{
		$this->{'iTxt'}=$txt;
	}
	return $this->{'iTxt'};
}

sub Version()
{
	my $this=shift;
	my ($ver)=@_;
	if (defined $ver)
	{
		$this->{'iVer'}=$ver;
	}
	return $this->{'iVer'};
}

sub GroupDes()
{	
	my $this=shift;
	my ($des)=@_;
	if (defined $des)
	{
		$this->{'iGroupDes'}=$des;
	}
	return $this->{'iGroupDes'};
}

1;

